import { createRouter, createWebHashHistory } from "vue-router";
import Logon from "../views/Logon.vue";
import Register from "../views/Register.vue";
import resetPassword from "../views/resetPassword.vue";
import essayList from "../views/EssayList.vue";
import planList from "../views/PlanList.vue";
import My from "../views/My.vue";
import Home from "../views/Home.vue";

const routes = [
  {
    path: "/",
    name: "Logon",
    component: Logon,
  },
  {
    path: "/register",
    name: "Register",
    component: Register,
  },
  {
    path: "/resetPassword",
    name: "resetPassword",
    component: resetPassword,
  },
  // {
  //   path: "/essayList",
  //   name: "essayList",
  //   component: essayList,
  // },
  // {
  //   path: "/planList",
  //   name: "planList",
  //   component: planList,
  // },
  // {
  //   path: "/my",
  //   name: "My",
  //   component: My,
  // },
  {
    path: "/home",
    // name: "home",
    component: Home,
    children: [
      { path: "/essayList", name: "essayList", component: essayList,},
      { path: "/planList", name: "planList", component: planList,},
      { path: "/my", name: "My", component: My,},
    ]
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
